//
//  DiscoverViewController.m
//  govern
//
//  Created by LiangLigeng on 14-8-18.
//  Copyright (c) 2014年 LiangLigeng. All rights reserved.
//

#import "DiscoverViewController.h"
#import "WebViewController.h"

@interface DiscoverViewController ()

@end

@implementation DiscoverViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        self.title=@"广场";
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
#ifdef __IPHONE_7_0
    if ([[UIDevice currentDevice].systemVersion floatValue] >= 7.0) {
        self.edgesForExtendedLayout = UIRectEdgeNone;
    }
#endif
    //导航栏背景
    UIImage *navBack=[UIImage imageNamed:@"p2_top_bar.png"];
    [self.navigationController.navigationBar setBackgroundImage:navBack forBarMetrics:UIBarMetricsDefault];
    
    UIImageView *qianbanView=[[UIImageView alloc]initWithFrame:CGRectMake(35, 30, 250, 90)];
    [qianbanView setImage:[UIImage imageNamed:@"gc_qbzs.png"]];
    qianbanView.alpha=0.8;
    [self.view addSubview:qianbanView];
    qianbanView.userInteractionEnabled = YES;
    UITapGestureRecognizer *tapQianban=[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(tapQianban:)];
    [qianbanView addGestureRecognizer:tapQianban];
    
    UIImageView *weiboView=[[UIImageView alloc]initWithFrame:CGRectMake(35, 150, 250, 90)];
    [weiboView setImage:[UIImage imageNamed:@"gc_wb.png"]];
    weiboView.alpha=0.8;
    [self.view addSubview:weiboView];
    weiboView.userInteractionEnabled = YES;
    UITapGestureRecognizer *tapWeibo=[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(tapWeibo:)];
    [weiboView addGestureRecognizer:tapWeibo];
    
    UIImageView *weixinView=[[UIImageView alloc]initWithFrame:CGRectMake(35, 270, 250, 90)];
    [weixinView setImage:[UIImage imageNamed:@"gc_wx.png"]];
    weixinView.alpha=0.8;
    [self.view addSubview:weixinView];

}

-(void)tapQianban:(UITapGestureRecognizer *)gesture
{
    WebViewController *webViewCtrl=[[WebViewController alloc]init];
    [webViewCtrl setUrl: @"http://apply.gzgov.gov.cn/default.aspx"];
    [self.navigationController pushViewController:webViewCtrl animated:YES];
    NSLog(@"qianban");
}

-(void)tapWeibo:(UITapGestureRecognizer *)gesture
{
    WebViewController *webViewCtrl=[[WebViewController alloc]init];
    [webViewCtrl setUrl: @"http://focus.weibo.com/pub/i/zt/gzzwwbfbt"];
    [self.navigationController pushViewController:webViewCtrl animated:YES];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
